﻿@model S4Store.Models.Markting.YDXJBHistoryModel
@{
    Layout = null;
    ViewBag.Title = "YDJKXGHistory";

        S4Store.Models.Chart.Line ChartModel1 = new S4Store.Models.Chart.Line();
        ChartModel1.Name = "移动媒体发帖执行率";
        ChartModel1.YAxis = "比率(%)";
        for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
        {
            ChartModel1.XAxis.Add(dt.ToString("M月"));
        }
        foreach(var media in Model.Medias){
            S4Store.Models.Chart.ChartSeries series1 = new S4Store.Models.Chart.ChartSeries();
            series1.Name = media.Name + "发帖执行率";
            for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
            {
                var report = Model.Reports.FirstOrDefault(t => t.Year == dt.Year && t.Month == dt.Month && t.Media.Id == media.Id);
                series1.Data.Add(report.FTZXLV);
            }
            ChartModel1.Serieses.Add(series1);
        }


        S4Store.Models.Chart.Line ChartModel2 = new S4Store.Models.Chart.Line();
        ChartModel2.Name = "移动媒体关注度变化率";
        ChartModel2.YAxis = "万元";
        for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
        {
            ChartModel2.XAxis.Add(dt.ToString("M月"));
        }
        foreach (var media in Model.Medias)
        {
            S4Store.Models.Chart.ChartSeries series1 = new S4Store.Models.Chart.ChartSeries();
            series1.Name = media.Name + "关注度变化率";
            for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
            {
                var report = Model.Reports.FirstOrDefault(t => t.Year == dt.Year && t.Month == dt.Month && t.Media.Id == media.Id);
                series1.Data.Add(report.GZDBHLV);
            }
            series1.Precision = 3;
            ChartModel2.Serieses.Add(series1);
        }
}
<div style="height:100%; width:100%; overflow:auto">
@Html.Action("ReportBar", "Common", Model.BarModel)
<div class="pageContent">
	
	<div class="tabs" currentIndex="0" eventType="click">
		<div class="tabsHeader">
			<div class="tabsHeaderContent">
				<ul>
                        <li><a href="javascript:;"><span>移动媒体发帖执行率</span></a></li>
                        <li><a href="javascript:;"><span>移动媒体关注度变化率</span></a></li>                 			
				</ul>
			</div>
		</div>
		<div class="tabsContent" >
			<div>
            @Html.Partial("../Chart/Line", ChartModel1)
			</div>
			<div>
            @Html.Partial("../Chart/Line", ChartModel2)
			</div>
           
		</div>
		<div class="tabsFooter">
			<div class="tabsFooterContent"></div>
		</div>
	</div>
</div>

</div>
